/**
 * 日期范围工具类
 */

const getCurrentCNDt = function () {
    // 获取当前时间
    const now = new Date();

    // 获取各个时间组件
    const year = now.getFullYear();
    const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的，所以需要+1，并且补0
    const day = String(now.getDate()).padStart(2, '0'); // 补0
    const hours = String(now.getHours()).padStart(2, '0'); // 补0
    const minutes = String(now.getMinutes()).padStart(2, '0'); // 补0
    const seconds = String(now.getSeconds()).padStart(2, '0'); // 补0
    const milliseconds = String(now.getMilliseconds()).padStart(3, '0'); // 补0

    // 格式化输出
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
};

/***
 * 获得本周起止时间
 */
const getCurrentWeek = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//返回date是一周中的某一天
	var week = currentDate.getDay();
	//返回date是一个月中的某一天
	var month = currentDate.getDate();

	//一天的毫秒数
	var millisecond = 1000 * 60 * 60 * 24;
	//减去的天数
	var minusDay = week != 0 ? week - 1 : 6;
	//alert(minusDay);
	//本周 周一
	var monday = new Date(currentDate.getTime() - (minusDay * millisecond));
	//本周 周日
	var sunday = new Date(monday.getTime() + (6 * millisecond));
	//添加本周时间
	startStop.push(monday.format("yyyy-MM-dd")); //本周起始时间
	startStop.push(currentDate.format("yyyy-MM-dd")); //本周现在时间
	//添加本周最后一天时间
	startStop.push(sunday.format("yyyy-MM-dd")); //本周终止时间
	//返回
	return startStop;
};
/***
 * 获得上周起止时间
 */
const getLastWeek = function () {
	//起止日期数组
	var startStop = new Array();
	var date = new Date();
	var weekday = date.getDay() || 7;
	date.setDate(date.getDate() - weekday + 1);
	var sdt = new Date(date.getTime() - 86400000 * 7);
	var edt = new Date(date.getTime() - 86400000 * 1);
	function backnumb(data) {
		var numb = '';
		if (data < 10) {
			numb = '0' + data;
		} else {
			numb = data;
		};
		return numb
	};
	var sdtdate = sdt.getFullYear() + '-' + backnumb(sdt.getMonth() + 1) + '-' + backnumb(sdt.getDate());
	var edtdate = edt.getFullYear() + '-' + backnumb(edt.getMonth() + 1) + '-' + backnumb(edt.getDate());
	//添加至数组中返回
	startStop.push(sdtdate);
	startStop.push(date.format("yyyy-MM-dd")); //现在时间
	startStop.push(edtdate);
	//返回
	return startStop;
}

/***
 * 获得本月的起止时间
 */
const getCurrentMonth = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//获得当前月份0-11
	var currentMonth = currentDate.getMonth();
	//获得当前年份4位年
	var currentYear = currentDate.getFullYear();
	//求出本月第一天
	var firstDay = new Date(currentYear, currentMonth, 1);


	//当为12月的时候年份需要加1
	//月份需要更新为0 也就是下一年的第一个月
	if (currentMonth == 11) {
		currentYear++;
		currentMonth = 0; //就为
	} else {
		//否则只是月份增加,以便求的下一月的第一天
		currentMonth++;
	}


	//一天的毫秒数
	var millisecond = 1000 * 60 * 60 * 24;
	//下月的第一天
	var nextMonthDayOne = new Date(currentYear, currentMonth, 1);
	//求出上月的最后一天
	var lastDay = new Date(nextMonthDayOne.getTime() - millisecond);

	//添加至数组中返回
	startStop.push(firstDay.format("yyyy-MM-dd"));
	startStop.push(new Date().format("yyyy-MM-dd")); //现在时间
	startStop.push(lastDay.format("yyyy-MM-dd"));
	//返回
	return startStop;
};

/***
 * 获得上月的起止时间
 */
const getLastMonth = function () {
	//起止日期数组
	var startStop = new Array();
	var ssdate = new Date(new Date().getFullYear(), new Date().getMonth() - 1);
	var sdtdate = ssdate.getFullYear() + '-' + backnumb(ssdate.getMonth() + 1) + '-01';
	var day = new Date(new Date().getFullYear(), new Date().getMonth(), 0).getDate();
	var enddate = new Date(new Date().getFullYear(), new Date().getMonth() - 1, day);
	function backnumb(data) {
		var numb = '';
		if (data < 10) {
			numb = '0' + data;
		} else {
			numb = data;
		};
		return numb
	};
	var edtdate = enddate.getFullYear() + '-' + backnumb(enddate.getMonth() + 1) + '-' + backnumb(enddate.getDate());
	//添加至数组中返回
	startStop.push(sdtdate);
	startStop.push(edtdate);
	//返回
	return startStop;
}

/**
 * 得到本季度开始的月份
 * @param month 需要计算的月份
 ***/
const getQuarterSeasonStartMonth = function (month) {
	var quarterMonthStart = 0;
	var spring = 0; //春
	var summer = 3; //夏
	var fall = 6; //秋
	var winter = 9; //冬
	//月份从0-11
	if (month < 3) {
		return spring;
	}

	if (month < 6) {
		return summer;
	}

	if (month < 9) {
		return fall;
	}

	return winter;
};

/**
 * 获得该月的天数
 * @param year年份
 * @param month月份
 * */
const getMonthDays = function (year, month) {
	//本月第一天 1-31
	var relativeDate = new Date(year, month, 1);
	//获得当前月份0-11
	var relativeMonth = relativeDate.getMonth();
	//获得当前年份4位年
	var relativeYear = relativeDate.getFullYear();

	//当为12月的时候年份需要加1
	//月份需要更新为0 也就是下一年的第一个月
	if (relativeMonth == 11) {
		relativeYear++;
		relativeMonth = 0;
	} else {
		//否则只是月份增加,以便求的下一月的第一天
		relativeMonth++;
	}
	//一天的毫秒数
	var millisecond = 1000 * 60 * 60 * 24;
	//下月的第一天
	var nextMonthDayOne = new Date(relativeYear, relativeMonth, 1);
	//返回得到上月的最后一天,也就是本月总天数
	return new Date(nextMonthDayOne.getTime() - millisecond).getDate();
};

/**
 * 获得本季度的起止日期
 */
const getCurrentSeason = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//获得当前月份0-11
	var currentMonth = currentDate.getMonth();
	//获得当前年份4位年
	var currentYear = currentDate.getFullYear();
	//获得本季度开始月份
	var quarterSeasonStartMonth = getQuarterSeasonStartMonth(currentMonth);
	//获得本季度结束月份
	var quarterSeasonEndMonth = quarterSeasonStartMonth + 2;

	//获得本季度开始的日期
	var quarterSeasonStartDate = new Date(currentYear, quarterSeasonStartMonth, 1);
	//获得本季度结束的日期
	var quarterSeasonEndDate = new Date(currentYear, quarterSeasonEndMonth, getMonthDays(currentYear,
		quarterSeasonEndMonth));
	//加入数组返回
	startStop.push(quarterSeasonStartDate.format("yyyy-MM-dd"));
	startStop.push(currentDate.format("yyyy-MM-dd")); //现在时间
	startStop.push(quarterSeasonEndDate.format("yyyy-MM-dd"));
	//返回
	return startStop;
};

/***
 * 得到本年的起止日期
 *
 */
const getCurrentYear = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//获得当前年份4位年
	var currentYear = currentDate.getFullYear();

	//本年第一天
	var currentYearFirstDate = new Date(currentYear, 0, 1);
	//本年最后一天
	var currentYearLastDate = new Date(currentYear, 11, 31);
	//添加至数组
	startStop.push(currentYearFirstDate.format("yyyy-MM-dd"));
	startStop.push(currentDate.format("yyyy-MM-dd")); //现在时间
	startStop.push(currentYearLastDate.format("yyyy-MM-dd"));
	//返回
	return startStop;
};

/**
 * 返回上一个月的第一天Date类型
 * @param year 年
 * @param month 月
 **/
const getPriorMonthFirstDay = function (year, month) {
	//年份为0代表,是本年的第一月,所以不能减
	if (month == 0) {
		month = 11; //月份为上年的最后月份
		year--; //年份减1
		return new Date(year, month, 1);
	}
	//否则,只减去月份
	month--;
	return new Date(year, month, 1);;
};

/**
 * 获得上一月的起止日期
 * ***/
const getPreviousMonth = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//获得当前月份0-11
	var currentMonth = currentDate.getMonth();
	//获得当前年份4位年
	var currentYear = currentDate.getFullYear();
	//获得上一个月的第一天
	var priorMonthFirstDay = getPriorMonthFirstDay(currentYear, currentMonth);
	//获得上一月的最后一天
	var priorMonthLastDay = new Date(priorMonthFirstDay.getFullYear(), priorMonthFirstDay.getMonth(), getMonthDays(
		priorMonthFirstDay.getFullYear(), priorMonthFirstDay.getMonth()));
	//添加至数组
	startStop.push(priorMonthFirstDay.format("yyyy-MM-dd"));
	startStop.push(currentDate.format("yyyy-MM-dd")); //现在时间
	startStop.push(priorMonthLastDay.format("yyyy-MM-dd"));
	//返回
	return startStop;
};


/**
 * 获得上一周的起止日期
 * **/
const getPreviousWeek = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//返回date是一周中的某一天
	var week = currentDate.getDay();
	//返回date是一个月中的某一天
	var month = currentDate.getDate();
	//一天的毫秒数
	var millisecond = 1000 * 60 * 60 * 24;
	//减去的天数
	var minusDay = week != 0 ? week - 1 : 6;
	//获得当前周的第一天
	var currentWeekDayOne = new Date(currentDate.getTime() - (millisecond * minusDay));
	//上周最后一天即本周开始的前一天
	var priorWeekLastDay = new Date(currentWeekDayOne.getTime() - millisecond);
	//上周的第一天
	var priorWeekFirstDay = new Date(priorWeekLastDay.getTime() - (millisecond * 6));

	//添加至数组
	startStop.push(priorWeekFirstDay.format("yyyy-MM-dd"));
	startStop.push(currentDate.format("yyyy-MM-dd")); //现在时间
	startStop.push(priorWeekLastDay.format("yyyy-MM-dd"));

	return startStop;
};

/**
 * 得到上季度的起始日期
 * year 这个年应该是运算后得到的当前本季度的年份
 * month 这个应该是运算后得到的当前季度的开始月份
 * */
const getPriorSeasonFirstDay = function (year, month) {
	var quarterMonthStart = 0;
	var spring = 0; //春
	var summer = 3; //夏
	var fall = 6; //秋
	var winter = 9; //冬
	//月份从0-11
	switch (month) { //季度的其实月份
		case spring:
			//如果是第一季度则应该到去年的冬季
			year--;
			month = winter;
			break;
		case summer:
			month = spring;
			break;
		case fall:
			month = summer;
			break;
		case winter:
			month = fall;
			break;

	};

	return new Date(year, month, 1);
};

/**
 * 得到上季度的起止日期
 * **/
const getPreviousSeason = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//获得当前月份0-11
	var currentMonth = currentDate.getMonth();
	//获得当前年份4位年
	var currentYear = currentDate.getFullYear();
	//上季度的第一天
	var priorSeasonFirstDay = getPriorSeasonFirstDay(currentYear, currentMonth);
	//上季度的最后一天
	var priorSeasonLastDay = new Date(priorSeasonFirstDay.getFullYear(), priorSeasonFirstDay.getMonth() + 2, getMonthDays(
		priorSeasonFirstDay.getFullYear(), priorSeasonFirstDay.getMonth() + 2));
	//添加至数组
	startStop.push(priorSeasonFirstDay.format("yyyy-MM-dd"));
	startStop.push(currentDate.format("yyyy-MM-dd")); //现在时间
	startStop.push(priorSeasonLastDay.format("yyyy-MM-dd"));
	return startStop;
};

/**
 * 得到去年的起止日期
 * **/
const getPreviousYear = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//获得当前年份4位年
	var currentYear = currentDate.getFullYear();
	currentYear--;
	var priorYearFirstDay = new Date(currentYear, 0, 1);
	var priorYearLastDay = new Date(currentYear, 11, 1);
	//添加至数组
	startStop.push(priorYearFirstDay.format("yyyy-MM-dd"));
	startStop.push(currentDate.format("yyyy-MM-dd")); //现在时间
	startStop.push(priorYearLastDay.format("yyyy-MM-dd"));
	return startStop;
};
// 近3个月
const getLast3Month = function () {
	var now = new Date();
	var year = now.getFullYear();
	var month = now.getMonth() + 1; //0-11表示1-12月
	var day = now.getDate();
	var dateObj = {};
	//起止日期数组
	var startStop = new Array();
	dateObj.now = year + '-' + month + '-' + day;
	var nowMonthDay = new Date(year, month, 0).getDate(); //当前月的总天数
	if (month - 3 <= 0) { //如果是1、2、3月，年数往前推一年
		var last3MonthDay = new Date((year - 1), (12 - (3 - parseInt(month))), 0).getDate(); //3个月前所在月的总天数
		if (last3MonthDay < day) { //3个月前所在月的总天数小于现在的天日期
			dateObj.last = (year - 1) + '-' + (12 - (3 - month)) + '-' + last3MonthDay;
		} else {
			dateObj.last = (year - 1) + '-' + (12 - (3 - month)) + '-' + day;
		}
	} else {
		var last3MonthDay = new Date(year, (parseInt(month) - 3), 0).getDate(); //3个月前所在月的总天数
		if (last3MonthDay < day) { //3个月前所在月的总天数小于现在的天日期
			if (day < nowMonthDay) { //当前天日期小于当前月总天数,2月份比较特殊的月份
				dateObj.last = year + '-' + (month - 3) + '-' + (last3MonthDay - (nowMonthDay - day));
			} else {
				dateObj.last = year + '-' + (month - 3) + '-' + last3MonthDay;
			}
		} else {
			dateObj.last = year + '-' + (month - 3) + '-' + day;
		}
	}
	startStop.push(dateObj.last);
	startStop.push(now.format("yyyy-MM-dd")); //现在时间
	startStop.push(dateObj.now);
	return startStop;
}

/***
 * 得到今年的起止日期
 *
 */
const getCurrentNowYear = function () {
	var startStop = new Array();
	var sdtdate = new Date().getFullYear() + '-01-01';
	var edtdate = new Date().format("yyyy-MM-dd");
	startStop.push(sdtdate);
	startStop.push(new Date().format("yyyy-MM-dd")); //现在时间
	startStop.push(edtdate);
	return startStop;
}

/***
 * 得到上半年的起止日期
 *
 */
const getCurrentHalfYear = function () {
	//起止日期数组
	var startStop = new Array();
	//获取当前时间
	var currentDate = new Date();
	//获得当前年份4位年
	var currentYear = currentDate.getFullYear();

	//本年第一天
	var currentYearFirstDate = new Date(currentYear, 0, 1);
	//本年最后一天
	var currentYearLastDate = new Date(currentYear, 5, 30);
	//添加至数组
	startStop.push(currentYearFirstDate.format("yyyy-MM-dd"));
	startStop.push(currentYearLastDate.format("yyyy-MM-dd"));
	//返回
	return startStop;
};

/***
 * 得到去年年的起止日期
 *
 */
const getLastYear = function () {
	//起止日期数组
	var startStop = new Array();
	var year = new Date().getFullYear() - 1;
	var beginTime = year + '-01-01';
	var endTime = year + '-12-31';
	startStop.push(beginTime);
	startStop.push(endTime);
	return startStop;
}

Date.prototype.format = function (fmt) {
	var o = {
		"M+": this.getMonth() + 1, //月份
		"d+": this.getDate(), //日
		"h+": this.getHours(), //小时
		"m+": this.getMinutes(), //分
		"s+": this.getSeconds(), //秒
		"q+": Math.floor((this.getMonth() + 3) / 3), //季度
		"S": this.getMilliseconds() //毫秒
	};
	if (/(y+)/.test(fmt)) {
		fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	}
	for (var k in o) {
		if (new RegExp("(" + k + ")").test(fmt)) {
			fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
		}
	}
	return fmt;
}

// 近1个月
const getLast1Month = function () {
	var now = new Date();
	var year = now.getFullYear();
	var month = now.getMonth() + 1; //0-11表示1-12月
	var day = now.getDate();
	var dateObj = {};
	//起止日期数组
	var startStop = new Array();
	dateObj.now = year + '-' + month + '-' + day;
	var nowMonthDay = new Date(year, month, 0).getDate(); //当前月的总天数
	if (month - 1 <= 0) { //如果是1月，年数往前推一年
		var last3MonthDay = new Date((year - 1), (12 - (1 - parseInt(month))), 0).getDate(); //3个月前所在月的总天数
		if (last3MonthDay < day) { //3个月前所在月的总天数小于现在的天日期
			dateObj.last = (year - 1) + '-' + (12 - (1 - month)) + '-' + last3MonthDay;
		} else {
			dateObj.last = (year - 1) + '-' + (12 - (1 - month)) + '-' + day;
		}
	} else {
		var last3MonthDay = new Date(year, (parseInt(month) - 1), 0).getDate(); //3个月前所在月的总天数
		if (last3MonthDay < day) { //3个月前所在月的总天数小于现在的天日期
			if (day < nowMonthDay) { //当前天日期小于当前月总天数,2月份比较特殊的月份
				dateObj.last = year + '-' + (month - 1) + '-' + (last3MonthDay - (nowMonthDay - day));
			} else {
				dateObj.last = year + '-' + (month - 1) + '-' + last3MonthDay;
			}
		} else {
			dateObj.last = year + '-' + (month - 1) + '-' + day;
		}
	}
	startStop.push(dateObj.last);
	startStop.push(now.format("yyyy-MM-dd")); //现在时间
	startStop.push(dateObj.now);
	return startStop;
}
// 近3个天
const getLast3Day = function () {
	var now = new Date();
	var year = now.getFullYear();
	var month = now.getMonth() + 1; //0-11表示1-12月
	var day = now.getDate();
	var dateObj = {};
	//起止日期数组
	var startStop = new Array();
	dateObj.last = new Date(now.getTime() - 86400000 * 3);
	startStop.push(dateObj.last.format("yyyy-MM-dd"));
	startStop.push(now.format("yyyy-MM-dd")); //现在时间
	startStop.push(dateObj.now);
	return startStop;
}
// 近7个天
const getLast7Day = function () {
	var now = new Date();
	var year = now.getFullYear();
	var month = now.getMonth() + 1; //0-11表示1-12月
	var day = now.getDate();
	var dateObj = {};
	//起止日期数组
	var startStop = new Array();
	dateObj.last = new Date(now.getTime() - 86400000 * 7);
	startStop.push(dateObj.last.format("yyyy-MM-dd"));
	startStop.push(now.format("yyyy-MM-dd")); //现在时间
	startStop.push(dateObj.now);
	return startStop;
}

// 今天
const getLastToday = function () {
	var now = new Date();
	var dateObj = {};
	//起止日期数组
	var startStop = new Array();
	dateObj.last = new Date(now.getTime());
	startStop.push(dateObj.last.format("yyyy-MM-dd"));
	startStop.push(dateObj.last.format("yyyy-MM-dd")); //现在时间
	startStop.push(dateObj.now);
	return startStop;
}

// 昨天
const getYesterday = function () {
	var now = new Date();
	var dateObj = {};
	//起止日期数组
	var startStop = new Array();
	dateObj.last = new Date(now.getTime() - 86400000 * 1);
	startStop.push(dateObj.last.format("yyyy-MM-dd"));
	startStop.push(dateObj.last.format("yyyy-MM-dd")); //现在时间
	startStop.push(dateObj.now);
	return startStop;
}

// 当前时间
const getCurrentDateTime = function () {
	const now = new Date();
	const timezoneOffset = now.getTimezoneOffset() * 60000; // 将分钟转换为毫秒
	const localTime = now.getTime() - timezoneOffset;
	const formattedDate = new Date(localTime).toISOString();
	return formattedDate;
}


const formatDate = (dateStr ?: string | Date, formatStr ?: string) => {
	const date = dateStr ? new Date(dateStr) : new Date();
	const format = formatStr || 'YYYY-MM-DD HH:mm:ss';

	const padZero = (num : number, length : number = 2) : string => String(num).padStart(length, '0');

	const map : { [key : string] : string } = {
		'YYYY': date.getFullYear().toString(),
		'YY': padZero(date.getFullYear()).slice(-2),
		'MM': padZero(date.getMonth() + 1),
		'M': (date.getMonth() + 1).toString(),
		'DD': padZero(date.getDate()),
		'D': date.getDate().toString(),
		'HH': padZero(date.getHours()),
		'H': date.getHours().toString(),
		'mm': padZero(date.getMinutes()),
		'm': date.getMinutes().toString(),
		'ss': padZero(date.getSeconds()),
		's': date.getSeconds().toString(),
		'SSS': padZero(date.getMilliseconds(), 3)
	};

	return format.replace(/YYYY|YY|MM|M|DD|D|HH|H|mm|m|ss|s|SSS/g, matched => map[matched]);
}

const getCurrentDayBegin = () => {
	return getDayBegin(new Date());
}

/**
 * @description 日初
 *
 * @param date 时间
 * @returns {Date} 某一天的0时0分0秒
 */
const getDayBegin = (date : Date) => {
	return formatDate(new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0));
}

const getCurrentDayEnd = () => {
	return getDayEnd(new Date());
}

/**
 * @description 日末
 *
 * @param date 时间
 * @returns {Date} 某一天的23时59分59秒
 */
const getDayEnd = (date : Date) => {
	return formatDate(new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999));
}

// 时:分
const getHourMin = function (dateStr ?: string) {
	const date = dateStr ? new Date(dateStr) : new Date();
	const padZero = (num : number, length : number = 2) : string => String(num).padStart(length, '0');
	// 获取时、分
	const hours = padZero(date.getHours());
	const minutes = padZero(date.getMinutes());
	return `${hours}:${minutes}`;
}

// 月日 周
const getDateWeek = function (dateStr ?: string) {
	const date = dateStr ? new Date(dateStr) : new Date();
	// 获取月份、日期
	const month = date.getMonth() + 1;
	const day = date.getDate();
	// 星期
	const weekDays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
	const weekDay = weekDays[date.getDay()];
	return `${month}月${day}日 ${weekDay}`;
}

// 当前时间
const getCurrentTime = function (dateStr ?: string) {
	const now = new Date();
	const year = now.getFullYear();
	const month = String(now.getMonth() + 1).padStart(2, '0');
	const day = String(now.getDate()).padStart(2, '0');
	const hours = String(now.getHours()).padStart(2, '0');
	const minutes = String(now.getMinutes()).padStart(2, '0');
	const seconds = String(now.getSeconds()).padStart(2, '0');
	return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}

// 计算时间差
const calculateTimeDifference = function (startTime ?: string, endTime ?: string) {
	const startDate = startTime ? new Date(startTime) : new Date();
	const endDate = endTime ? new Date(endTime) : new Date();
	// 计算时间差（毫秒）
	const differenceInMillis: number = endDate.getTime() - startDate.getTime();
	// 转换为分钟
	const differenceInMinutes: number = Math.floor(differenceInMillis / (1000 * 60));
	// 计算小时和分钟
	const hours: number = Math.floor(differenceInMinutes / 60);
	const minutes: number = differenceInMinutes % 60;
	// 根据小时和分钟生成输出
	if (hours > 0) {
		return `${hours}小时${minutes}分钟`;
	} else {
		return `${minutes}分钟`;
	}
}

export default {
	getCurrentWeek,
	getLastWeek,
	getCurrentMonth,
	getLastMonth,
	getCurrentSeason,
	getLast3Month,
	getCurrentHalfYear,
	getCurrentNowYear,
	getCurrentYear,
	getLastYear,
	getLast1Month,
	getLast3Day,
	getLast7Day,
	getLastToday,
	getCurrentDateTime,
	formatDate,
	getYesterday,
	getCurrentDayBegin,
	getDayBegin,
	getCurrentDayEnd,
	getDayEnd,
	getHourMin,
	getDateWeek,
	getCurrentTime,
	calculateTimeDifference,
	getCurrentCNDt
}
